﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/MasterPage.Master" AutoEventWireup="true" CodeBehind="PhieuTraPhong_View.aspx.cs" Inherits="QLKS.Views.PhieuTraPhong_View" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="title-right"><span></span>Phiếu Trả Phòng</div>
    <ul class="button">
        <li><asp:LinkButton style="background: url('/Content/themes/add_bt.png') no-repeat 5px #E0DEDE; " ID="btnNew" runat="server" onclick="btnNew_Click"><span></span>Thêm</asp:LinkButton></li>
        <li><asp:LinkButton style="background: url('/Content/themes/del_bt.png') no-repeat 5px #E0DEDE; " ID="btnDelete" runat="server" onclick="btnDelete_Click" OnClientClick="return confirm('Bạn có thực sư muốn xóa dữ liệu này??');"><span></span>Xóa</asp:LinkButton></li>
        <li><asp:LinkButton style="background: url('/Content/themes/fitx_bt.png') no-repeat 5px #E0DEDE; " ID="btnEdit" runat="server" onclick="btnEdit_Click"><span></span>Sửa</asp:LinkButton></li>
        <li><asp:LinkButton style="background: url('/Content/themes/sav_bt.png') no-repeat 5px #E0DEDE; " ID="btnSave" runat="server" onclick="btnSave_Click" OnClientClick="return checkInput();" ><span></span>Lưu</asp:LinkButton></li>
        <li><asp:LinkButton style="background: url('/Content/themes/can_bt.png') no-repeat 5px #E0DEDE; " ID="btnCancel" runat="server" onclick="btnCancel_Click"><span></span>Hủy</asp:LinkButton></li>
    </ul>
    <asp:Panel ID="pnlMain" runat="server" CssClass="swap-product">
        <asp:GridView ID="gvMain" runat="server" AutoGenerateColumns="False" GridLines="None" 
            AllowPaging="True"  AllowSorting="True" CssClass="list-grid" ShowHeaderWhenEmpty="true"
            onpageindexchanging="gvMain_PageIndexChanging" onrowdatabound="gvMain_RowDataBound" onsorting="gvMain_Sorting" >
            <Columns>
                <asp:TemplateField>
                    <HeaderStyle Width="20px"/>
					<ItemStyle Width="20px"/>
					<HeaderTemplate>
						<asp:CheckBox ID="chkall" Runat="server" TextAlign="Left" />
					</HeaderTemplate>
					<ItemTemplate>
						<asp:CheckBox ID="chkid" Runat="server" TextAlign="Left" />
					</ItemTemplate>
					<HeaderStyle HorizontalAlign="Left" />
				</asp:TemplateField>
				<asp:TemplateField HeaderText="STT">
					<ItemStyle Width="20px" />
					<HeaderStyle Width="20px"/>
					<ItemTemplate>
						<%# Container.DataItemIndex + 1 %>
					</ItemTemplate>
				</asp:TemplateField>
				<asp:TemplateField Visible="false">
					<ItemTemplate>
						<asp:Label ID="lblID" runat="server" Text='<%#Bind("MaPhieuTraPhong") %>'></asp:Label>
					</ItemTemplate>
				</asp:TemplateField>
				<asp:BoundField DataField="PhieuThuePhong.PhongThue.TenPhong" HeaderText="Phòng trả" SortExpression="PhieuThuePhong.PhongThue.TenPhong" >
					<ItemStyle Width = "150" CssClass="name" />
				</asp:BoundField>
                <asp:BoundField DataField="PhieuThuePhong.NgayThuePhong" HeaderText="Ngày thuê phòng" SortExpression="PhieuThuePhong.NgayThuePhong" >
				</asp:BoundField>
                <asp:BoundField DataField="NgayTraPhong" HeaderText="Ngày trả phòng" SortExpression="NgayTraPhong" >
				</asp:BoundField>
                <asp:BoundField DataField="SoNgayThue" HeaderText="Số ngày thuê" SortExpression="SoNgayThue" >
				</asp:BoundField>
                <asp:BoundField DataField="GhiChu" HeaderText="Ghi chú" >
				</asp:BoundField>
            </Columns>
        </asp:GridView>
    </asp:Panel>
    <asp:Panel ID="pnlUpdate" runat="server" CssClass="swap-product" Visible="false" >
        <table style="width:100%" border="0" class="list-update">
            <tr>
				<td style="width:20%;" align="right">Phong thuê:</td>
				<td>
					<asp:DropDownList ID="ddlPhongThue" runat="server" Width="308px" AutoPostBack="true" 
                        CssClass="combobox" onselectedindexchanged="ddlPhongThue_SelectedIndexChanged">
                    </asp:DropDownList>
				</td>
			</tr>
            <tr>
				<td style="width:20%;" align="right">Ngày thuê phòng:</td>
				<td>
					<asp:TextBox ID="txtNgayThuePhong" runat="server" MaxLength="10" CssClass="textbox" ReadOnly="true" Width="300px"></asp:TextBox>
				</td>
			</tr>
            <tr>
				<td style="width:20%;" align="right">Ngày trả phòng:</td>
				<td>
					<asp:TextBox ID="txtNgayTraPhong" runat="server" MaxLength="10" CssClass="textbox" ReadOnly="true" Width="300px"></asp:TextBox>
				</td>
			</tr>
            <tr>
                <td style="width:20%;" align="right">Số ngày thuê:</td>
				<td>
				    <asp:TextBox ID="txtSoNgayThue" runat="server" MaxLength="10" CssClass="textbox" ReadOnly="true" Width="300px"></asp:TextBox>
				</td>
            </tr>
            <tr>
				<td style="width:20%;" align="right">Ghi chú:</td>
				<td>
					<asp:TextBox ID="txtGhiChu" runat="server" MaxLength="500" TextMode="MultiLine" Rows="5" CssClass="textbox" Width="300px"></asp:TextBox>
				</td>
			</tr>
        </table>
    </asp:Panel>

    <script type="text/javascript">
        function checkInput() {
            var isValid = true;
            $('.list-update input.required').each(function () {
                if ($.trim($(this).val()) == '') {
                    isValid = false;
                    $(this).css({ "border": "1px solid red", "background": "#FFCECE" });
                }
                else {
                    $(this).css({ "border": "", "background": "" });
                }
            });

            return isValid;
        }
    </script>
</asp:Content>
<asp:Content ID="Content3" runat="server" contentplaceholderid="Menu">
<dl>
    <dt class="currentac"><a href="#">QUẢN LÝ PHÒNG</a></dt>
    <dd  class="currentac" style="display: block;">
        <ul>
            <li ><a href="Index.aspx">Tổng quan</a></li>
            <li ><a href="PhieuThuePhong_View.aspx">Phiếu thuê phòng</a></li>
            <li class="currentac"><a href="PhieuTraPhong_View.aspx">Phiếu trả phòng</a></li>
            <li><a href="HoaDon_View.aspx">Hóa đơn</a></li>
        </ul>
    </dd>
    <dt  ><a class="" href="#">HỆ THỐNG</a></dt>
    <dd style="display: none;">
        <ul>
            <li ><a href="DMPhong_View.aspx">Danh mục phòng</a></li>
            <li ><a href="DMKhachHang_View.aspx">Danh mục khách hàng</a></li>
            <li><a href="DMLoaiPhong_View.aspx">Danh mục loại phòng</a></li>
            <li><a href="DMLoaiKhachHang_View.aspx">Danh mục loại khách hàng</a></li>
            <li ><a href="DMNguoiDung_View.aspx">Danh mục người dùng</a></li>
            <li ><a href="ThamSoHeThong_View.aspx">Tham số hệ thống</a></li>
        </ul>
    </dd>
    <dt class=""><a href="#">BÁO CÁO</a></dt>
    <dd  style="display: none;">
        <ul>
            <li><a href="BaoCaoDoanhThuTheoLoaiPhong_View.aspx">Doanh thu theo loại phòng</a></li>
            <li><a href="BaoCaoMatDoSuDungPhong_View.aspx">Mật độ sử dụng phòng</a></li>
        </ul>
    </dd>
                            
</dl>
</asp:Content>